<include file="../header" />
<body class="J_scroll_fixed">
    <script type="text/javascript">
    $(function() {

        $('button.editCompany').click(function () {
            var shopId = $("select[name=shopId]").val();
            var mobile = $("input[name=mobile]").val()
            var companyName = $("input[name=companyName]").val()
            var address = $("input[name=address]").val()

            
            if(shopId==0||shopId==null){
                layer.msg('请选择一个店铺!');
                return false;
            }
            if(companyName==''||companyName==null){
                layer.msg('公司名称不能为空!');
                return false;
            }
            if(address==''||address==null){
                layer.msg('公司地址不能为空!');
                return false;
            }
             //验证手机号格式
            if(!mobileValidate($.trim(mobile))) {             
                return false;
            }else{
                    $("#editForm").submit();
                }
            });

    });
</script>
	<div class="wrap jj">
		<div class="common-form">
			<form id="editForm" method="post" class="form-horizontal J_ajaxForm" action="{:U('company/edit_post')}">
				<input type='hidden' name='id' value='{$company.company_id}'/>
                                <fieldset>
					<div class="control-group">
						<label class="control-label">店铺：</label>
						<div class="controls">
							{:getShopSelectHtml($company['shop_id'],1)}
						</div>
					</div>
                                        <div class="control-group">
						<label class="control-label">公司名称：</label>
						<div class="controls">
							<input type="text" class="input" name="companyName" value="{$company.company_name}">
						</div>
					</div>
                                    <div class="control-group">
						<label class="control-label">地址：</label>
						<div class="controls">
							<input type="text" class="input" name="address" value="{$company.address}">
						</div>
					</div>
                                        <div class="control-group">
						<label class="control-label">联系方式：</label>
						<div class="controls">
							<input type="text" class="input" name="mobile" value="{$company.mobile}">
						</div>
					</div>
                                        
				</fieldset>
				<div class="form-actions">
                                    <button  class="editCompany btn btn-primary">更新</button>
                                    <a class="btn" href="__URL__">返回</a>
				</div>
			</form>
		</div>
	</div>
	<script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>